Skip to content

[OutputManager] Removes use_name report filter option.#2876

Merged
ew3361zh merged 20 commits intodevfrom
eval-use-name
Mar 25, 2026
Merged

[OutputManager] Removes use_name report filter option.#2876
ew3361zh merged 20 commits intodevfrom
eval-use-name

Conversation

@ew3361zh
Copy link
Collaborator

@ew3361zh ew3361zh commented Mar 21, 2026

Evaluated use_name output filter option and determined it was no longer needed.

Context

Issue(s) closed by this pull request: closes #2778

What

  1. Removes all references to use_name in OutputManager and DieselConsumption.
  2. Refactors DieselConsumption reporting function that relied on use_name formatting to reflect use of default filtering and data parsing in OutputManager (in this case because the output is in a dictionary format it will use the full variable name address for each dictionary element).

Why

The use_name option was helpful for parsing and filtering variables nested in dictionaries and being able to distinguish their values properly. With refactors done in OutputManager that now consistently provide the full variable address for those nested variables, it is a more reliable filtering/parsing process. Leaving the use_name option available actually made that process now less reliable because it was performing a similar role but in a slightly different manner. Removing it to avoid confusion seemed the best plan.

How

Removed all references to use_name from OutputManager and DieselConsumption.
DieselConsumption relied on this output parsing process to properly distinguish between these nested field variables. So I refactored the parsing process for DieselConsumption to use the now universally default verbose variable naming process for nested variables.

Test plan

The main thing to test is whether DieselConsumption is still reporting the same as it was on dev. I used this filter for that on this feature branch:

{
  "direction": "landscape",
  "multiple": [
  {
    "name": "ShaqDiesel",
    "filters": [
      ".*total_diesel_consumption_tractor_implement.*",
      ".*EnergyEstimator.report_diesel_consumption.*"
    ]
  }
  ]
}

Compare that to the results on dev using a similar filter but slightly different because the function name in the info map was incorrect:

{
  "direction": "landscape",
  "multiple": [
  {
    "name": "ShaqDiesel",
    "filters": [
      ".*total_diesel_consumption_tractor_implement.*",
      ".*EnergyEstimator.estimate_all.*"
    ]
  }
  ]
}

Input Changes

Output Changes

  • N/A

Filter

@github-actions
Copy link
Contributor

Current Coverage: 99%

Mypy errors on eval-use-name branch: 1219
Mypy errors on dev branch: 1211
8 more errors on eval-use-name branch

@github-actions
Copy link
Contributor

🚨 Please update the changelog. This PR cannot be merged until changelog.md is updated.

@github-actions
Copy link
Contributor

Current Coverage: 99%

Mypy errors on eval-use-name branch: 1213
Mypy errors on dev branch: 1211
2 more errors on eval-use-name branch

base_info_map = {
"class": EnergyEstimator.__name__,
"function": EnergyEstimator.estimate_all.__name__,
"function": EnergyEstimator.report_diesel_consumption.__name__,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the incorrect function name previously and changing it will change existing filters using regex patterns with the old function name. I will update dev team channel once this PR is approved.

Copy link
Collaborator

@matthew7838 matthew7838 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the outputs were also the same after the changes on my side. Left a minor comment. Great work, Niko.

Copy link
Collaborator

@JoeWaddell JoeWaddell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with existing report filters, including those that used the use_name field, and all works as expected.

There are some slight differences in reported values, but on the order of <0.3% differences, which I concluded are likely simply due to random number generation (I was using the same input files for both, the same seed, but if there are different numbers of operations then some events will unfold differently, regardless of the seed being identical). The small differences were across multiple modules, so not restricted to the more directly affected fields here.

@github-actions
Copy link
Contributor

Current Coverage: 99%

Mypy errors on eval-use-name branch: 1214
Mypy errors on dev branch: 1212
2 more errors on eval-use-name branch

@github-actions
Copy link
Contributor

Current Coverage: 99%

Mypy errors on eval-use-name branch: 1212
Mypy errors on dev branch: 1212
No difference in error counts

@ew3361zh ew3361zh merged commit 6b1bf25 into dev Mar 25, 2026
1 check passed
@ew3361zh ew3361zh deleted the eval-use-name branch March 25, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify expected behavior with use_name and use_verbose_report_name

3 participants